<template>
  <div class="home-swiper">
    <van-swipe v-if="banner.length" class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in banner" :key="item.id">
        <img :src="item.img_url" :alt="item.title">
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
export default {
  props: {
    banner: {
      type: Array,
      default: () => {
        return [];
      },
    },
  },
};
</script>

<style lang="scss" scoped>
img {
  width: 100%;
  height: auto;
}
</style>